/**
 * 测试嵌套循环
 */

public class TestLoop01 {

    public static void main(String[] args) {
        for (int n = 1; n <= 5; n++) {
            for (int i = 1; i <= 5; i++) {
                System.out.print(n + "\t");
            }
            System.out.println();//打印5次后换行，再打印
        }


        //打印九九乘法表

       /* //打印1*3=3 2*3=6 3*3=9
        for(int n=1;n<=3;n++) {
            System.out.print(n + "*" + 3 + "=" + "n*3" + "\t");
        }
        System.out.println();//换行
        //打印1*4=4 2*4=8 3*4=12
        for(int m=1;m<=4;m++){
            System.out.print(m + "*" + 4 + "=" + "m*3" + "\t");
        }*/

        for(int n =1;n<=9;n++) {
            for(int m=1;m<=n;m++){
                //System.out.print(n+"*"+m+"="+n*m+"\t");
                System.out.print(n+"*"+m+"="+(n*m<10?(" "+n*m):n*m)+"\t");
            }
            System.out.println();
        }

    }
}
